package anno;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("prototype")
//该注解作用是在bean中实例化，并设定该实例的作用区域，相当于<bean id="user" Class="anno.User" scope=“prototype”>
public class User {
    @Value("ww")
    //给对象赋值，相当于<property id="name" value="ww">
    public String name;

    @Value("ww")
    //可以放在set方法上
    public void setName(String name) {
        this.name = name;
    }
}
